<?php

require_once ROOT . 'components' . DS . 'emerald_framework' . DS . 'E_ARB.php'; 

$path_to_models = ROOT . 'application'.DS.'models'.DS;

$model_names = array();

if ($handle = opendir($path_to_models)) {
    while (false !== ($file = readdir($handle))) {
        if ($file[0] != ".") {
        	require_once $path_to_models . $file;
            $model_names[] = end(get_declared_classes());
        }
    }
    closedir($handle);
}

foreach ($model_names as $key => $value) {;
	if (property_exists($value, 'properties')) {
		$table_name = strtolower($value);

		echo "CREATE TABLE $table_name";
		
		echo print_r($value::$properties);
	}
}

?>